﻿
var getJsonTree = function (data, pcode) {
    var itemArr = [];
    for (var i = 0; i < data.length; i++) {
        var node = data[i];
        if (node.pcode == pcode) {
            var newNode = { code: node.code, text: node.text, xh: i, level: node.level, nodes: getJsonTree(data, node.code) };
            itemArr.push(newNode);
        }
    }
    return itemArr;
}

function DelNullNode(data) {
    for (var i = 0; i < data.length; i++) {
        var getChild = data[i].nodes;
        if (getChild.length>0) {
            DelNullNode(getChild);
        } else {
            delete data[i]["nodes"];
        }
    }
}

var Area_GNQ_Json = [
{
    "text": "江北新区",
    "code": "GNPQ_0001"
},
{
    "text": "空港枢纽经济区",
    "code": "GNPQ_0002"
},
{
    "text": "河西中央商务区",
    "code": "GNPQ_0003"
},
{
    "text": "海港枢纽经济区",
    "code": "GNPQ_0004"
},
{
    "text": "江北海港枢纽经济区",
    "code": "GNPQ_0005"
},
{
    "text": "七坝海港枢纽经济区",
    "code": "GNPQ_0006"
},
{
    "text": "滨江海港枢纽经济区",
    "code": "GNPQ_0007"
},
{
    "text": "南京江东商贸区",
    "code": "GNPQ_0008"
},
{
    "text": "南京高新技术开发区",
    "code": "GNPQ_0009"
},
{
    "text": "高淳经济开发区",
    "code": "GNPQ_0010"
},
{
    "text": "南京经济技术开发区",
    "code": "GNPQ_0011"
},
{
    "text": "栖霞区技术经济开发区",
    "code": "GNPQ_0012"
},
{
    "text": "南京雨花经济开发区",
    "code": "GNPQ_0013"
},
{
    "text": "南京江宁经济技术开发区",
    "code": "GNPQ_0014"
},
{
    "text": "南京下关滨江商务区",
    "code": "GNPQ_0015"
}
];

var Area_CYYQ_Json = [
{
    "text": "南京化学工业园",
    "code": "CYYQ_0001"
},
{
    "text": "麒麟科技创新园",
    "code": "CYYQ_0002"
},
{
    "text": "南京徐庄软件园",
    "code": "CYYQ_0003"
},
{
    "text": "南京白下高新技术产业园区",
    "code": "CYYQ_0004"
},
{
    "text": "新城科技园",
    "code": "CYYQ_0005"
},
{
    "text": "南京浦口经济开发区",
    "code": "CYYQ_0006"
},
{
    "text": "南京海峡两岸科技工业园",
    "code": "CYYQ_0007"
},
{
    "text": "南京出口加工区（南区）",
    "code": "CYYQ_0008"
}
];

//行政区
var Area_XZQ_Json = [];
var LS_Area_XZQ_Json = [

/*{
    "pcode": "430000000000",
    "code": "430100000000",
    "text": "长沙市",
    "level": "3",
    "SMX": "112.9388453666",
    "SMY": "28.2277765095"
},*/
{
    "pcode": "430100000000",
    "code": "430104000000",
    "text": "岳麓区",
    "level": "4",
    "SMX": "112.9259188300",
    "SMY": "28.2388201900"
},
{
    "pcode": "430100000000",
    "code": "430112000000",
    "text": "望城区",
    "level": "4",
    "SMX": "112.8123756700",
    "SMY": "28.3646174800"
},
{
    "pcode": "430100000000",
    "code": "430182000000",
    "text": "宁乡市",
    "level": "4",
    "SMX": "112.5518426722",
    "SMY": "28.2774285748"
},
{
    "pcode": "430104000000",
    "code": "430104001000",
    "text": "望月湖街道",
    "level": "5",
    "SMX": "112.9523727199",
    "SMY": "28.2015038638"
},
{
    "pcode": "430104000000",
    "code": "430104002000",
    "text": "岳麓街道",
    "level": "5",
    "SMX": "112.9295910334",
    "SMY": "28.1604797331"
},
{
    "pcode": "430104000000",
    "code": "430104003000",
    "text": "桔子洲街道",
    "level": "5",
    "SMX": "112.9512901255",
    "SMY": "28.1647451011"
},
{
    "pcode": "430104000000",
    "code": "430104004000",
    "text": "银盆岭街道",
    "level": "5",
    "SMX": "112.9543238599",
    "SMY": "28.2216366805"
},
{
    "pcode": "430104000000",
    "code": "430104005000",
    "text": "观沙岭街道",
    "level": "5",
    "SMX": "13229173.2558553",
    "SMY": "3757234.85981665"
},
{
    "pcode": "430104000000",
    "code": "430104006000",
    "text": "望城坡街道",
    "level": "5",
    "SMX": "112.9170119690",
    "SMY": "28.2046837146"
},
{
    "pcode": "430104000000",
    "code": "430104007000",
    "text": "西湖街道",
    "level": "5",
    "SMX": "112.9314422178",
    "SMY": "28.2032052230"
},
{
    "pcode": "430104000000",
    "code": "430104008000",
    "text": "咸嘉湖街道",
    "level": "5",
    "SMX": "112.9220716190",
    "SMY": "28.2227156458"
},
{
    "pcode": "430104000000",
    "code": "430104009000",
    "text": "望岳街道",
    "level": "5",
    "SMX": "112.9225301590",
    "SMY": "28.2306950365"
},
{
    "pcode": "430104000000",
    "code": "430104010000",
    "text": "梅溪湖街道",
    "level": "5",
    "SMX": "112.8650232855",
    "SMY": "28.1876623287"
},
{
    "pcode": "430104000000",
    "code": "430104011000",
    "text": "麓谷街道",
    "level": "5",
    "SMX": "112.8892225778",
    "SMY": "28.2192816366"
},
{"pcode": "430104000000","code": "430104011000","text": "麓谷街道",    "level": "5",    "SMX": "112.877471","SMY": "28.226336"},
{"pcode": "430104000000","code": "430104012000","text": "坪塘街道",    "level": "5",    "SMX": "112.895579","SMY": "28.039387"},
{"pcode": "430104000000","code": "430104013000","text": "含浦街道",    "level": "5",    "SMX": "112.862825","SMY": "28.091242"},
{"pcode": "430104000000","code": "430104014000","text": "天顶街道",    "level": "5",    "SMX": "112.896593","SMY": "28.24853"},
{"pcode": "430104000000","code": "430104015000","text": "洋湖街道",    "level": "5",    "SMX": "112.932747","SMY": "28.106185"},
{"pcode": "430104000000","code": "430104016000","text": "学士街道",    "level": "5",    "SMX": "112.887203","SMY": "28.13962"},
{"pcode": "430104000000","code": "430104102000","text": "莲花镇",    "level": "5",    "SMX": "112.7734917771","SMY": "28.1137386169"},
{"pcode": "430104000000","code": "430104105000","text": "雨敞坪镇",    "level": "5",    "SMX": "112.686176","SMY": "28.15352"},
{"pcode": "430112000000","code": "430112001000","text": "高塘岭街道",    "level": "5",    "SMX": "112.786084","SMY": "28.399668"},
{"pcode": "430112000000","code": "430112003000","text": "丁字湾街道",    "level": "5",    "SMX": "112.913127","SMY": "28.370111"},
{"pcode": "430112000000","code": "430112005000","text": "大泽湖街道",    "level": "5",    "SMX": "112.908478","SMY": "28.325745"},
{"pcode": "430112000000","code": "430112006000","text": "月亮岛街道",    "level": "5",    "SMX": "112.924629","SMY": "28.290169"},
{"pcode": "430112000000","code": "430112007000","text": "白沙洲街道",    "level": "5",    "SMX": "114.287382","SMY": "30.520949"},
{"pcode": "430112000000","code": "430112008000","text": "金山桥街道",    "level": "5",    "SMX": "112.8338578973","SMY": "28.2627371837"},
{"pcode": "430112000000","code": "430112009000","text": "黄金园街道",    "level": "5",    "SMX": "112.812486","SMY": "28.281833"},
{"pcode": "430112000000","code": "430112011000","text": "乌山街道",    "level": "5",    "SMX": "112.760661","SMY": "28.341674"},
{"pcode": "430112000000","code": "430112012000","text": "铜官街道",    "level": "5",    "SMX": "112.850699","SMY": "28.441682"},
{"pcode": "430112000000","code": "430112013000","text": "雷锋街道",    "level": "5",    "SMX": "112.823104","SMY": "28.211256"},
{"pcode": "430112000000","code": "430112014000","text": "白马街道",    "level": "5",    "SMX": "112.8001373727","SMY": "28.2328801277"},
{"pcode": "430112000000","code": "430112101000","text": "桥驿镇",    "level": "5",    "SMX": "112.969247","SMY": "28.438775"},
{"pcode": "430112000000","code": "430112103000","text": "茶亭镇",    "level": "5",    "SMX": "112.899432","SMY": "28.506214"},
{"pcode": "430112000000","code": "430112106000","text": "靖港镇",    "level": "5",    "SMX": "112.716227","SMY": "28.441901"},
{"pcode": "430112000000","code": "430112107000","text": "乔口镇",    "level": "5",    "SMX": "112.718828","SMY": "28.500276"},
{"pcode": "430112000000","code": "430112115000","text": "白箬铺镇",    "level": "5",    "SMX": "112.739571","SMY": "28.239467"},
{"pcode": "430182000000","code": "430182001000","text": "玉潭街道",    "level": "5",    "SMX": "112.557551","SMY": "28.269612"},
{"pcode": "430182000000","code": "430182002000","text": "白马桥街道",    "level": "5",    "SMX": "112.538573","SMY": "28.248153"},
{"pcode": "430182000000","code": "430182003000","text": "历经铺街道",    "level": "5",    "SMX": "112.605801","SMY": "28.253563"},
{"pcode": "430182000000","code": "430182004000","text": "城郊街道",    "level": "5",    "SMX": "113.574392","SMY": "23.622084"},
{"pcode": "430182000000","code": "430182101000","text": "道林镇",    "level": "5",    "SMX": "112.727327","SMY": "28.008587"},
{"pcode": "430182000000","code": "430182102000","text": "花明楼镇",    "level": "5",    "SMX": "112.641087","SMY": "28.047605"},
{"pcode": "430182000000","code": "430182103000","text": "东湖塘镇",    "level": "5",    "SMX": "112.544343571","SMY": "28.0688410603"},
{"pcode": "430182000000","code": "430182104000","text": "夏铎铺镇",    "level": "5",    "SMX": "112.576283","SMY": "28.186991"},
{"pcode": "430182000000","code": "430182105000","text": "双江口镇",    "level": "5",    "SMX": "112.656635","SMY": "28.386324"},
{"pcode": "430182000000","code": "430182106000","text": "煤炭坝镇",    "level": "5",    "SMX": "112.394492","SMY": "28.26913"},
{"pcode": "430182000000","code": "430182107000","text": "坝塘镇",    "level": "5",    "SMX": "112.491084","SMY": "28.135123"},
{"pcode": "430182000000","code": "430182109000","text": "灰汤镇",    "level": "5",    "SMX": "112.342052","SMY": "27.993626"},
{"pcode": "430182000000","code": "430182110000","text": "双凫铺镇",    "level": "5",    "SMX": "112.310148","SMY": "28.117738"},
{"pcode": "430182000000","code": "430182111000","text": "老粮仓镇",    "level": "5",    "SMX": "112.186626","SMY": "28.063108"},
{"pcode": "430182000000","code": "430182112000","text": "流沙河镇",    "level": "5",    "SMX": "112.127031","SMY": "27.991754"},
{"pcode": "430182000000","code": "430182113000","text": "巷子口镇",    "level": "5",    "SMX": "111.978935","SMY": "28.110571"},
{"pcode": "430182000000","code": "430182114000","text": "龙田镇",    "level": "5",    "SMX": "111.9447684869","SMY": "28.0180788922"},
{"pcode": "430182000000","code": "430182116000","text": "横市镇",    "level": "5",    "SMX": "112.2223461503","SMY": "28.1469039254"},
{"pcode": "430182000000","code": "430182117000","text": "回龙铺镇",    "level": "5",    "SMX": "112.486188","SMY": "28.227809"},
{"pcode": "430182000000","code": "430182118000","text": "黄材镇",    "level": "5",    "SMX": "112.135218","SMY": "28.165164"},
{"pcode": "430182000000","code": "430182119000","text": "大成桥镇",    "level": "5",    "SMX": "112.361776","SMY": "28.183706"},
{"pcode": "430182000000","code": "430182120000","text": "青山桥镇",    "level": "5",    "SMX": "112.029515","SMY": "27.965189"},
{"pcode": "430182000000","code": "430182121000","text": "金洲镇",    "level": "5",    "SMX": "112.682269","SMY": "28.315477"},
{"pcode": "430182000000","code": "430182122000","text": "大屯营镇",    "level": "5",    "SMX": "112.664658","SMY": "27.979653"},
{"pcode": "430182000000","code": "430182123000","text": "资福镇",    "level": "5",    "SMX": "112.412196","SMY": "28.102705"},
{"pcode": "430182000000","code": "430182203000","text": "菁华铺乡",    "level": "5",    "SMX": "112.494314","SMY": "28.29905"},
{"pcode": "430182000000","code": "430182209000","text": "喻家坳乡",    "level": "5",    "SMX": "112.287018","SMY": "28.217618"},
{"pcode": "430182000000","code": "430182213000","text": "沙田乡",    "level": "5",    "SMX": "114.201876","SMY": "22.386002"},
{"pcode": "430182000000","code": "430182218000","text": "沩山乡",    "level": "5",    "SMX": "112.002995","SMY": "28.180906"}
];